<?php
require_once( '../system/smarty.inc' );
require_once( '../system/mdao/Class_M_USER.php' );
require_once( '../system/mdao/Class_M_OTHER.php' );


$dao = new Class_M_USER;

if( $_SERVER['REQUEST_METHOD'] == 'GET' ){
if( isset($_GET['id']) && $_GET['id'] != '' ){
		if( is_numeric( $_GET['id'] ) ){
			$forms  = $dao->get( $_GET['id'] );
		}
	}
	
if(isset($forms)){
		if(isset($forms['birthday'])){
			$forms['birthday_year'] = gmdate('Y',strtotime($forms['birthday']));
			$forms['birthday_m'] = gmdate('m',strtotime($forms['birthday']));
		}
		if(isset($forms['zipcode'])){
			$forms['zipcode1'] = substr($forms['zipcode'],0,3);
			$forms['zipcode2'] = substr($forms['zipcode'],3,strlen($forms['zipcode'])-1);
		}
		if(isset($forms['tel_number'])){
			$forms['tel_number1'] = substr($forms['tel_number'],0,2);
			$forms['tel_number2'] = substr($forms['tel_number'],2,4);
			$forms['tel_number3'] = substr($forms['tel_number'],6,strlen($forms['tel_number'])-1);
		}
		if(isset($forms['mobile_number'])){
			$forms['mobile_number1'] = substr($forms['mobile_number'],0,2);
			$forms['mobile_number2'] = substr($forms['mobile_number'],2,4);
			$forms['mobile_number3'] = substr($forms['mobile_number'],6,strlen($forms['mobile_number'])-1);
		}
    }		
}
if( isset( $forms ) ) $smarty->assign('forms', $forms);
$smarty->display('user_refer.html');
?>